package cn.ac.iscas.service.thesis;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.ac.iscas.bean.base.DAOSupport;
import cn.ac.iscas.bean.base.DeleteDocument;
import cn.ac.iscas.bean.patent.PatentPicture;
import cn.ac.iscas.bean.thesis.ThesisDocument;
@Service
@Transactional
public class ThesisDocServiceImp extends DAOSupport<ThesisDocument>
		implements IThesisDocService {
	@Override
	public void delete(Object entity) {
		ThesisDocument thesisDocument = (ThesisDocument)entity;
		DeleteDocument.deleteDocuments(thesisDocument.getUploadRealName());
		System.out.println(thesisDocument.getId());
		thesisDocument = (ThesisDocument)sessionFactory.getCurrentSession().get(ThesisDocument.class, thesisDocument.getId());
		sessionFactory.getCurrentSession().delete(thesisDocument);
	}
}
